<?php

/**
 * upload actions.
 *
 * @package    sf_sandbox
 * @subpackage upload
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
 */
class uploadActions extends sfActions
{
  /**
   * Executes index action
   *
   */
  public function executeIndex()
  {
    $this->forward('default', 'module');
  }
  
  public function executePrzeslijZdjecie(){
  	
  }
  
  public function executeOdbierzZdjecie(){
//  	if ($this->getRequest()->hasFiles()){
//  	$aZdjecia	= $this->getRequest()->getFileNames();
//  	}
  	
	foreach  ($this->getRequest()->getFileNames() as $sZdjecie) {
	echo $sZdjecie;  	
	}
  	print_r($sZdjecie);
  	
  	$sZdjecie	= $aZdjecia[0];
  	$this->$sNazwa = 	$this->getRequest()->getFileName($sZdjecie);
  	$this->$iRozmiar = 	$this->getRequest()->getFileSize($sZdjecie);
  	$this->$sTyp = 		$this->getRequest()->getFileType($sZdjecie);
  	$this->$bBlad = 	$this->getRequest()->hasFileError($sZdjecie);
  	$this->$sKatalogDocelowy = sfConfig::get('sf_upload_dir');
  	$this->getRequest()->moveFile($sZdjecie, $this->sKatalogDocelowy.'/'.$this->sNazwa);
  }
  
  
}
